var
	a:array[0..19] of longint;
	t,i,max,maxp:longint;
begin
	for i:=0 to 19 do
		read(a[i]);
	maxp:=0;
	max:=a[0]+a[1]+a[2]+a[3];
	for i:=1 to 19 do
	begin
		t:= a[i mod 20]+a[ (i+1) mod 20]+a[(i+2) mod 20] +a[(i+3)mod 20];
		if(t>max)then
		begin
			maxp:=i;
			max:=t;
		end;
	end;
	writeln(maxp+1,' ',max);
end.
